home *** CD-ROM | disk | FTP | other *** search
/ Top 200 Programs / Top 200 Programs.iso / Bob8 / THOMPSON / LIBERTY / PRODUCT / LB14W.EXE / CALLDLL3.BAS < prev    next >
BASIC Source File  |  1996-02-01  |  837b  |  50 lines

  1.  
  2.     'CALLDLL3.BAS   Show how to draw text directly into a window using
  3.     'API calls
  4.  
  5.     UpperLeftX = 10
  6.     UpperLeftY = 10
  7.     open "window" for window as #1
  8.  
  9.     open "user.dll" for dll as #user
  10.     open "gdi.dll" for dll as #gdi
  11.  
  12.     h = hwnd(#1)
  13.  
  14.     calldll #user, "GetDC", _
  15.         h as word, _
  16.         hdc as word
  17.  
  18.     x = 10
  19.     y = 10
  20.     text$ = "Ha ha ha!"
  21.     length = 9
  22.  
  23.     for y = 10 to 100 step 20
  24.  
  25.     calldll #gdi, "TextOut", _
  26.         hdc as word, _
  27.         x as short, _
  28.         y as short, _
  29.         text$ as struct, _
  30.         length as short, _
  31.         result as word
  32.  
  33.     next x
  34.  
  35.     calldll #user, "ReleaseDC", _
  36.         h as word, _
  37.         hdc as word, _
  38.         result as ushort
  39.  
  40.     notice "Done."
  41.  
  42.     close #user
  43.     close #gdi
  44.  
  45.     close #1
  46.  
  47.     end
  48.  
  49.  
  50.